<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /* 
        通过循环按行顺序为一个5×5的二维数组a赋1到25的自然数，
        然后输出该数组。试编程 */
        var arr = [];
        for (var i = 1; i <= 5; i++) {
            var arr1 = [];
            for (var j = 1; j <= 5; j++) {
                arr1.push(5*i-5+j);
            }
            arr.push(arr1);
        }

        console.log(arr);
    </script>
</body>

</html>